// pages/activity/connection/connection.js
var _this;
Page({

  /**
   * 页面的初始数据
   */
  data: {
    conUrl:'',
    userCode: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    _this = this;
    if (options.userCode){
      //var url = 'http://192.168.1.200/test/assets/templates/connection/index.html?userCode=' + options.userCode
      var url = 'https://www.ulpey.com/connection/index.html?userCode=' + options.userCode
      _this.setData({
        conUrl: url,
        userCode: options.userCode
      })
    }else{

    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage(options) { 
    //192.168.1.200/test/assets/templates
    //var url = 'http://192.168.1.200/test/assets/templates/connection/share.html?userCode=' + this.data.userCode
    var url = 'https://www.ulpey.com/connection/share.html?userCode=' + this.data.userCode
    options.webViewUrl = url
    
    return {
      title: '测圈子，抢现金',
      path: '/pages/activity/connection/share?userCode=' + this.data.userCode,
      //imageUrl: "/images/1.jpg",
      success: (res) => {
        console.log("转发成功", res);
      },
      fail: (res) => {
        console.log("转发失败", res);
      }
    }
  },
  bindGetMsg: function (e) {
    console.log(e.detail)
  }
})